﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MBWebService.Server.Proxy;
using MBWebService.Core.Classes;
using MBWebService.Core;

namespace MBWebService.Service
{
    public class ServiceCallback : IMediaBrowserServerCallback
    {
        #region IMediaBrowserServerCallback Members

        public bool PlayItem(string[] id, bool queue)
        {
            bool retVal = false;
            try
            {
                MediaCollection collection = new MediaCollection();
                collection.AddRange(id);
                MBWebService.Core.Classes.PlaybackDevice dev = new Core.Classes.PlaybackDevice
                {
                    IsMediaCenter = true,
                    IsRemote = false,
                    Name = AppSettings.SessionName
                };

                ServiceHelper.Instance.PlayCollection(dev, collection, queue);
            }
            catch (Exception ex)
            {
                MBWebService.Core.Logging.Logger.Instance.LogMessage("Error playing files. ERROR: {0}", ex.Message);
            }

            return retVal;
        }

        public MBWebService.Server.Proxy.NowPlayingItem GetNowPlaying(bool waitForUpdate)
        {
            throw new NotImplementedException();
        }

        public void SendCommand(CommandTypes command)
        {
            throw new NotImplementedException();
        }

        public void Seek(int seconds)
        {
            throw new NotImplementedException();
        }

        public void GoToScreen(ScreenType screenType, string extraInfo)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
